{% extends "single.html" %}

{% block title %}Setting{% endblock %}
{% block navpath %}
  <div class="page-header">
    <h1><small>设置</small></h1>
  </div>
{% endblock %}
{% block main %}
  <div class="col-xs-6">
    <div>
      <a href="{% url "avatar-modify" user.id %}"><img src="{{ MEDIA_URL }}150/{{ account.avatar }}" class="img-responsive img-thumbnail" alt="Responsive image"></a>

    </div>
    <form class="form-horizontal" role="form" method="post">
      {% csrf_token %}
      <div class="form-group">
        <label for="nickname" class="col-sm-2 control-label">{{ form.fields.nickname.label }}</label>
        <div class="col-sm-10">
          <input type="text" class="form-control" id="nickname" name="nickname" placeholder="{{ form.fields.nickname.help_text }}" value="{{ account.nickname }}">
          {% if form.nickname.errors %}
            {% for error in form.nickname.errors %}
              <p class="alert-danger" >{{ error }}</p>
            {% endfor %}
          {% endif %}
        </div>
      </div>
      <div class="form-group">
        <label for="truename" class="col-sm-2 control-label">{{ form.fields.truename.label }}</label>
        <div class="col-sm-10">
          <input type="text" class="form-control" id="truename" name="truename" placeholder="{{ form.fields.truename.label }}" value="{{ account.truename }}">
          {% if form.truename.errors %}
            {% for error in form.truename.errors %}
              <p class="alert-danger" >{{ error }}</p>
            {% endfor %}
          {% endif %}
        </div>
      </div>
      <div class="form-group">
        <label for="truename" class="col-sm-2 control-label">{{ form.fields.phone.label }}</label>
        <div class="col-sm-10">
          <input type="text" class="form-control" id="phone" name="phone" placeholder="{{ form.fields.phone.label }}" value="{{ account.phone }}">
          {% if form.phone.errors %}
            {% for error in form.phone.errors %}
              <p class="alert-danger" >{{ error }}</p>
            {% endfor %}
          {% endif %}
        </div>
      </div>
      <div class="form-group">
        <div class="col-sm-offset-2 col-sm-10">
          <button type="submit" class="btn btn-default">修改</button>
        </div>
      </div>
    </form>
  </div>
{% endblock %}
